package xml;

import org.apache.log4j.Logger;
import org.h2.jdbcx.JdbcConnectionPool;

import ua.epam.elective.Main;

public class ConnectionPoolHolder {
	private JdbcConnectionPool connectionPool;
	private static final Logger log = Logger.getLogger(Main.class);

	protected ConnectionPoolHolder() {
		log.info("ConnectionPoolHolder created.\n");
	};

	private static class SingletonHolder {
		public static final ConnectionPoolHolder INSTANCE = new ConnectionPoolHolder();
	}

	public static ConnectionPoolHolder getInstance() {
		return SingletonHolder.INSTANCE;
	}

	public static JdbcConnectionPool getConnectionPool() {
		return getInstance().connectionPool;
	}

	public void setConnectionPool(JdbcConnectionPool connectionPool) {
		this.connectionPool = connectionPool;
	}

}
